#define _CRT_SECURE_NO_WARNINGS 1
#include "Heap.h"


void AdjustDwon(HPDataType* a,int size ,int parent)
{
	int child1 = 2 * parent + 1;
	int child2 = 2 * parent + 2;

	while (child1 < size && child2< size)
	{
		if (a[child1] < a[child2])
		{
			if (a[child2] < a[parent])
			{
				swap(&a[child2],&a[parent]);
				parent = child2;
				child1 = 2 * child2 + 1;
				child2 = 2 * child2 + 2;
			}

			else
			{
				break;
			}
		}

		else
		{
			if (a[child1] < a[parent])
			{
				swap(&a[child1], &a[parent]);
				parent = child1;
				child2 = 2 * child1 + 2;
				child1 = 2 * child1 + 1;
				
			}

			else
			{
				break;
			}

		}


	}


}





int main()
{

	return 0;
}